<template name="creatorTable">
    <div class="panel panel-default creator-table">
        <div class="panel-body">
            <div class="panel-content">
                <table type='table' class="table table-condensed autoform-table" data-label="{{afFieldLabelText name=this.atts.name}}" data-max-index="{{maxIndex}}"
                    {{this.atts}} id="{{this.name}}Table" data-schema-key="{{this.name}}">
                    <thead id="{{this.name}}Thead" name="{{this.name}}Thead">

                    </thead>
                    <tbody id="{{this.name}}Tbody" name="{{this.name}}Tbody">
                    {{#each trField}}
						{{#if this}}
							{{> Template.dynamic template="creatorTableTr" data=(trData this)}}
						{{/if}}
					{{/each}}
					</tbody>
                    <tfoot id="{{this.name}}Tfoot" name="{{this.name}}Tfoot">

                    </tfoot>
                </table>
            </div>
        </div>
    </div>
</template>



<template name="creatorTableTr">
	<tr>
		<td class="delete-row" data-index = {{this.index}}>
			<i class="ion ion-close-round"></i>
		</td>
		{{#each fieldName this.index this.value}}
			{{#if isHiddenField this.key}}
				{{#if isDisabledField this.key}}
					<td class="hidden-field">
						<span class="disabled-field-value">{{disabledFieldsValue this.key}}</span>
						<span class="disabled-field">{{> afQuickField name=this.name disabled=false readonly=true label=false}}</span>
					</td>
				{{else}}
					<td class="hidden-field">{{> afQuickField name=this.name label=false}}</td>
				{{/if}}
			{{else}}
				{{#if isDisabledField this.key}}
					<td class="{{this.type}}">
						<span class="disabled-field-value">{{disabledFieldsValue this.key}}</span>
						<span class="disabled-field">{{> afQuickField name=this.name disabled=false readonly=true label=false}}</span>
					</td>
				{{else}}
					<td class="{{this.type}}">{{> afQuickField name=this.name label=false}}</td>
				{{/if}}
			{{/if}}
		{{/each}}
	</tr>
</template>